home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / protocols / routed.h < prev    next >
C/C++ Source or Header  |  2002-09-16  |  2KB  |  78 lines

  1. #ifndef PROTOCOLS_ROUTED_H
  2. #define    PROTOCOLS_ROUTED_H \
  3.        "$Id: routed.h,v 1.1.1.1 2001/11/26 22:21:18 tboeckel Exp $"
  4. /*
  5.  *      Routing Information Protocol
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. /*
  13.  * Routing Information Protocol
  14.  *
  15.  * Derived from Xerox NS Routing Information Protocol
  16.  * by changing 32-bit net numbers to sockaddr's and
  17.  * padding stuff to 32-bit boundaries.
  18.  */
  19. #define    RIPVERSION    1
  20.  
  21. struct netinfo {
  22.     struct    sockaddr rip_dst;    /* destination net/host */
  23.     int    rip_metric;        /* cost of route */
  24. };
  25.  
  26. struct rip {
  27.     u_char    rip_cmd;        /* request/response */
  28.     u_char    rip_vers;        /* protocol version # */
  29.     u_char    rip_res1[2];        /* pad to 32-bit boundary */
  30.     union {
  31.         struct    netinfo ru_nets[1];    /* variable length... */
  32.         char    ru_tracefile[1];    /* ditto ... */
  33.     } ripun;
  34. #define    rip_nets    ripun.ru_nets
  35. #define    rip_tracefile    ripun.ru_tracefile
  36. };
  37.  
  38. /*
  39.  * Packet types.
  40.  */
  41. #define    RIPCMD_REQUEST        1    /* want info */
  42. #define    RIPCMD_RESPONSE        2    /* responding to request */
  43. #define    RIPCMD_TRACEON        3    /* turn tracing on */
  44. #define    RIPCMD_TRACEOFF        4    /* turn it off */
  45.  
  46. #define    RIPCMD_MAX        5
  47. #ifdef RIPCMDS
  48. char *ripcmds[RIPCMD_MAX] =
  49.   { "#0", "REQUEST", "RESPONSE", "TRACEON", "TRACEOFF" };
  50. #endif
  51.  
  52. #define    HOPCNT_INFINITY        16    /* per Xerox NS */
  53. #define    MAXPACKETSIZE        512    /* max broadcast size */
  54.  
  55. /*
  56.  * Timer values used in managing the routing table.
  57.  * Complete tables are broadcast every SUPPLY_INTERVAL seconds.
  58.  * If changes occur between updates, dynamic updates containing only changes
  59.  * may be sent.  When these are sent, a timer is set for a random value
  60.  * between MIN_WAITTIME and MAX_WAITTIME, and no additional dynamic updates
  61.  * are sent until the timer expires.
  62.  *
  63.  * Every update of a routing entry forces an entry's timer to be reset.
  64.  * After EXPIRE_TIME without updates, the entry is marked invalid,
  65.  * but held onto until GARBAGE_TIME so that others may
  66.  * see it "be deleted".
  67.  */
  68. #define    TIMER_RATE        30    /* alarm clocks every 30 seconds */
  69.  
  70. #define    SUPPLY_INTERVAL        30    /* time to supply tables */
  71. #define    MIN_WAITTIME        2    /* min. interval to broadcast changes */
  72. #define    MAX_WAITTIME        5    /* max. time to delay changes */
  73.  
  74. #define    EXPIRE_TIME        180    /* time to mark entry invalid */
  75. #define    GARBAGE_TIME        240    /* time to garbage collect */
  76.  
  77. #endif /* !PROTOCOLS_ROUTED_H */
  78.